/*
 * @(#)MemberBOImpl.java $version 2013-3-4
 * 
 * Copyright 2013 NADO Group. All rights Reserved.
 * NADO PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.nado.iims2.community.bo.impl;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.nado.extensions.util.DataMap;
import com.nado.iims2.community.bo.MemberBO;
import com.nado.iims2.community.dao.MemberDAO;
import com.nado.iims2.community.model.MemberModel;

/**
 * The Class MemberBOImpl.
 * 
 * @author nado
 */
@Service("MemberBO")
public class MemberBOImpl implements MemberBO {
	/** The log. */
	private static Log log = LogFactory.getLog(MemberBOImpl.class);
	
	/** The member dao. */
	@Autowired
	private MemberDAO memberDAO = null;
	
	@Override
	public List<DataMap> getMemberList(String startDate, String endDate,
			String searchText, int offset, int count) {
		try {
			List<DataMap> result = new ArrayList<DataMap>();
			result = memberDAO.selectMemberList(startDate, endDate, searchText, offset, count);
			return result;
		} catch (Exception e) {
			log.error(e, e);
			return new ArrayList<DataMap>();
		}
	}

	@Override
	public int getMemberListCount(String startDate, String endDate,
			String searchText) {
		try {
			return memberDAO.selectMemberListCount(startDate, endDate, searchText);
		} catch (Exception e) {
			log.error(e, e);
			return 0;
		}
	}

	@Override
	public MemberModel getMemberDetail(String memberId) {
		try {
			MemberModel model = new MemberModel();
			model = memberDAO.selectMemberDetail(memberId);
			return model;
		} catch (Exception e) {
			log.error(e, e);
			return null;			
		}
	}

	@Override
	public int removeMember(String memberId) {
		return 0;
	}

}
